package cn.cdeden.knowledge.service;

import cn.cdeden.common.core.utils.page.TableDataInfo;
import cn.cdeden.knowledge.domain.EnterpriseMaterialFilesTree;
import cn.cdeden.knowledge.service.dto.EnterpriseMaterialFilesTreeDto;
import cn.cdeden.knowledge.service.dto.EnterpriseMaterialFilesTreeQueryParam;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;

/**
* @author GW
* @date 2024-02-21
*/
public interface EnterpriseMaterialFilesTreeService extends IService<EnterpriseMaterialFilesTree> {

    static final String CACHE_KEY = "enterpriseMaterialFilesTree";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<EnterpriseMaterialFilesTreeDto>
    */
    TableDataInfo<EnterpriseMaterialFilesTreeDto> queryAll(EnterpriseMaterialFilesTreeQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<EnterpriseMaterialFilesTreeDto>
    */
    List<EnterpriseMaterialFilesTreeDto> queryAll(EnterpriseMaterialFilesTreeQueryParam query);

    EnterpriseMaterialFilesTree getById(Long id);
    EnterpriseMaterialFilesTreeDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    boolean insert(EnterpriseMaterialFilesTreeDto resources);
    boolean updateById(EnterpriseMaterialFilesTreeDto resources);
    boolean deleteById(Long id);
    boolean deleteByIds(Set<Long> ids);

    EnterpriseMaterialFilesTreeDto uploadEnterpriseMaterialFiles(MultipartFile image, MultipartFile file, String realName, String parentId,Long deptId);

    TableDataInfo<EnterpriseMaterialFilesTreeDto> getMaterialsFilePage(EnterpriseMaterialFilesTreeQueryParam param, Pageable pageable);

    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<EnterpriseMaterialFilesTreeDto> all, HttpServletResponse response) throws IOException;
}
